'use strict';

var fs = require('fs');

var data = 'Hello,Node.js!';

fs.writeFile('testjs/output.txt',data,function(err){
    if(err){
        console.log(err);
    }else{
        console.log('ok!');
    }
});
try {
    fs.writeFileSync('testjs/output.txt',data);
    console.log('ok');
} catch (error) {
    console.log(error);
}
